public class XuanZang extends Handler{

    @Override

    public void handleRequest(String request) {
        if (request.equals("取经")) {
            System.out.println("唐僧：我来负责取经任务。");
        } else {
            if (successor != null) {
                successor.handleRequest(request);
            } else {
                System.out.println("无法处理这个请求。");
            }
        }
    }

}
